package org.example.consumer;


import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumeControl1 {
    @Resource
    RestTemplate restTemplate;

    @RequestMapping("/consumer1")
    public String cons1() {
        System.out.println("consumer1 called.........");
        String prodRet = restTemplate.getForEntity("http://scloud-prj2-provider1/provider1", String.class).getBody();
        return prodRet + "  by consumer1@20240225";
    }
}
